package com.skymxc.wandroidtodo.page.add;

import com.skymxc.wandroidtodo.data.net.APIManager;
import com.skymxc.wandroidtodo.entity.TODOItem;
import com.skymxc.wandroidtodo.mvp.IModel;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import io.reactivex.Observable;

/**
 * <p>
 *
 * </p>
 *
 * @author 孟祥超
 * <p>
 * date: 2021/12/3  7:21 上午
 */
class AddItemModel implements IModel {

    public Observable<TODOItem> addItem(String title, String content){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
        String date = simpleDateFormat.format(new Date());
        return APIManager.getInstance()
                .addItem(title,content,date,1,1);
    }
}
